﻿using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using System;

namespace Sustainalytics.Entities
{
    public class Event : IEntity
    {
        public Guid Id { get; set; }

        public string Name { get; set; }

        public string NameLowerCase
        {
            get
            {
                var name = this.Name;
                if (name == null)
                    return name;
                return name.ToLowerInvariant();
            }
            set
            {

            }
        }

        public DateTime StartDate { get; set; }
        
        public DateTime EndDate { get; set; }

        public Guid AddedByUserId { get; set; }

        public string AddedByName { get; set; }

        public string AddedByNameLowerCase
        {
            get
            {
                var userName = this.AddedByName;
                if (userName == null)
                    return userName;
                return userName.ToLowerInvariant();
            }
            set
            {

            }
        }
        public bool Sponsorship { get; set; }

        public string Presenter { get; set; }
        
        [BsonRepresentation(BsonType.String)]
        public EventStatus Status { get; set; }

        public string Body { get; set; }

        public string Location { get; set; }

        public DateTime? PublishedDate { get; set; }

    }
}
